package Frame;


import java.awt.FlowLayout;
import java.awt.Image;
import java.awt.Toolkit;

import javax.swing.JFrame;
import javax.swing.JScrollPane;
import javax.swing.JTextArea;

public class Frame extends JFrame{
	
	private static Image icon;
	private static Frame frame = new Frame("elizebeth");
	private static JTextArea text = new JTextArea(30,70);
	private static JScrollPane scoll = new JScrollPane(text);
	static{
		icon = Toolkit.getDefaultToolkit().createImage(Frame.class.getResource("/pic/splash.gif"));
		frame.setIconImage(icon);
		text.setLineWrap(true) ;
		text.setEditable(false);
		frame.setLayout(new FlowLayout());
		scoll.setHorizontalScrollBar(null);
		frame.add(scoll);
		frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		frame.setSize(800,600);
		frame.setVisible(true);
		frame.setResizable(false);
	}
	
	private Frame(String str) {
		super(str);
	}
	
	public static void append(String str){
		text.append(str+"\n");
		int rows = text.getLineCount();
		if(rows > 1000){
			text.setText("");
		}
	}

}
